﻿/* 
 * TABLE: dbo.Comments 
 */

/* 
 * TABLE: Comments 
 */

CREATE TABLE Comments(
    CommentId        int               IDENTITY(1,1),
    Description      nvarchar(1000)    NOT NULL,
    DateOfPublish    datetime          NULL,
    UserId           int               NOT NULL,
    ResponseId       int               NOT NULL,
    CONSTRAINT PK_Comments PRIMARY KEY NONCLUSTERED (CommentId)
)
GO
ALTER TABLE Comments ADD CONSTRAINT FKUsers_Comments 
    FOREIGN KEY (UserId)
    REFERENCES Users(UserId)
GO
/* 
 * TABLE: dbo.Comments 
 */

/* 
 * TABLE: Comments 
 */

ALTER TABLE Comments ADD CONSTRAINT RefResponses25 
    FOREIGN KEY (ResponseId)
    REFERENCES Responses(ResponseId)